#include "my_label.h"
#include <QMouseEvent>
#include <QDebug>
#include <QLabel>

my_label::my_label(QWidget* parent)
    : QLabel(parent)
{}

void my_label::enterEvent(QEnterEvent* event)
{
    (void)event;
    qDebug() << "enterEvent";
}

void my_label::leaveEvent(QEvent* event)
{
    (void)event;
    qDebug() << "leaveEvent";
}

void my_label::mousePressEvent(QMouseEvent* event)
{
    char buffer[1024];
    sprintf(buffer, "mousePressEvent:%d, %d", event->x(), event->y());
    qDebug() << buffer;
}

void my_label::mouseReleaseEvent(QMouseEvent* event)
{
    char buffer[128];
    sprintf(buffer, "mouseReleaseEvent: %d %d", event->x(), event->y());
    qDebug() << buffer;
}

void my_label::mouseDoubleClickEvent(QMouseEvent* event)
{
    char buffer[128];
    sprintf(buffer, "mouseDoubleClickEvent: %d %d", event->x(), event->y());
    qDebug() << buffer;
}
